package com.sos.comm
{
	public class CallError
	{
		
		// -------------------------------------------------------------------------------
		// FIELDS
		// -------------------------------------------------------------------------------
		
		private var _type:CallErrorType;
		private var _code:int;
		private var _message:String;
		
		// -------------------------------------------------------------------------------
		// CONSTRUCTOR
		// -------------------------------------------------------------------------------
		
		public function CallError(type:CallErrorType, code:int, message:String="")
		{
			_type = type;
			_code = code;
			_message = message;
		}
		
		// -------------------------------------------------------------------------------
		// PROPERTIES
		// -------------------------------------------------------------------------------
		
		public function get type():CallErrorType
		{
			return _type;
		}

		public function get code():int
		{
			return _code;
		}

		public function get message():String
		{
			return _message;
		}
		
		// -------------------------------------------------------------------------------
		// PUBLIC METHODS
		// -------------------------------------------------------------------------------
		
		public function toString():String
		{
			return _message + " (code: " + _code + ", type: " + _type.name + ")"; 
		}


	}
}